package com.zyz.L_泛型.泛型使用;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @author: vick
 * @Date: 2025/4/2
 * @Description:
 * @version: 1.0
 */
public class Demo1 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(18);
        list.add(28);
        list.add(38);
        list.add(48);
        //list.add("sss");//编译报错

        Iterator<Integer> iterator = list.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

    }
}
